<template>
  <div>
    <div>
      <el-form ref="form"
               :model="vipvo"
               label-width="80px"
               style="width: 80%;">
        <el-form-item label="会员等级">
          <el-statistic group-separator=","
                        :precision="0"
                        v-model="vipvo.vipLevel"></el-statistic>
        </el-form-item>
        <el-form-item label="会员积分">
          <el-statistic group-separator=","
                        :precision="2"
                        v-model="vipvo.vipNum"></el-statistic>
        </el-form-item>
        <el-form-item label="折扣价格">
          <el-statistic group-separator=","
                        :precision="2"
                        v-model="vipvo.discountPrice"></el-statistic>
        </el-form-item>

      </el-form>

    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      vipvo: {
        //   vipNum: 400,
        //  vipLevel: 1,
        //  discountPrice:200
      },

      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    };
  },
  methods: {
    format (percentage) {
      return percentage === 100 ? '满' : `${percentage}%`;
    },
    handleEdit () {
      console.log(this.userId);
      this.$axios.get("vips/" + this.userId).then((resp) => {
        this.vipvo = resp.data.data.vipvo;
        // this.dialog.updateshow = true;
      });

    },
    onSubmit () {
      console.log('submit!');
    }
  },
  created () {
    this.userId = JSON.parse(sessionStorage.getItem("userId"));
    console.log(this.userId);
    this.handleEdit();
  }
};
</script>
<style scoped>
.like {
  cursor: pointer;
  font-size: 25px;
  display: inline-block;
}
</style>